# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=cairomm

pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.11.2
pkgrel=1
pkgdesc="C++ bindings to Cairo vector graphics library (mingw-w64)"
arch=('any')
url="http://www.cairographics.org"
license=("LGPL, MPL")
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" "${MINGW_PACKAGE_PREFIX}-pkg-config" "${MINGW_PACKAGE_PREFIX}-glib2")
depends=( "${MINGW_PACKAGE_PREFIX}-libsigc++" "${MINGW_PACKAGE_PREFIX}-cairo")
options=(strip staticlibs)
source=("http://www.cairographics.org/releases/cairomm-${pkgver}.tar.gz")
sha1sums=('35e190a03f760924bece5dc1204cc36b3583c806')

build() {
  CPPFLAGS+=" -D_REENTRANT"
  export lt_cv_deplibs_check_method='pass_all'
  mkdir -p "${srcdir}/build-${MINGW_CHOST}"
  cd "${srcdir}/build-${MINGW_CHOST}"
  "${srcdir}"/${_realname}-${pkgver}/configure \
    --prefix=${MINGW_PREFIX} \
    --build=${MINGW_CHOST} \
    --host=${MINGW_CHOST} \
    --enable-shared \
    --enable-static \
    --disable-documentation
  make
}

package() {
  cd "${srcdir}/build-${MINGW_CHOST}"
  make DESTDIR="$pkgdir" install
  find "${pkgdir}${MINGW_PREFIX}" -name '*.def' -o -name '*.exp' | xargs -rtl1 rm
}
